﻿using Ebusiness_OrderService.Data;
using Ebusiness_OrderService.Model;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Domain.Repositories.EntityFrameworkCore;
using Volo.Abp.EntityFrameworkCore;

namespace Ebusiness_OrderService.Repositorys
{
    [Dependency(ServiceLifetime.Transient)]
    public class OrderRepository : EfCoreRepository<Ebusiness_OrderServiceDbContext, Order, Guid>, IOrderRepository
    {
        public OrderRepository(IDbContextProvider<Ebusiness_OrderServiceDbContext> dbContextProvider) : base(dbContextProvider)
        {

        }

        public override async Task<Order> InsertAsync(Order entity, bool autoSave = false, CancellationToken cancellationToken = default)
        {
            //var db = (await GetDbContextAsync()).GetHashCode();
            //var ti = this.GetHashCode();
            return await base.InsertAsync(entity, autoSave, cancellationToken);
        }
    }
}
